#include "head.h"

int cmd_process(char *cmd_head, char *cmd_body, COMMAND *command){

    // 处理命令头 -> 后续长短命令分析
    if (strcmp(cmd_head, "cd") == 0) {
        *command = cd;
    } else if (strcmp(cmd_head, "ls") == 0) {
        *command = ls;
    } else if (strcmp(cmd_head, "pwd") == 0) {
        *command = pwd;
    } else if (strcmp(cmd_head, "mkdir") == 0) {
        *command = mk_dir;
    } else if (strcmp(cmd_head, "rm") == 0) {
        *command = rm_dir;
    } else if (strcmp(cmd_head, "undorm") == 0) {
        *command = undo_rm;
    } else if (strcmp(cmd_head, "upload") == 0) {
        *command = upload;
    } else if (strcmp(cmd_head, "download") == 0) {
        *command = download;
    }

    return 0;
}
